jQuery(document).ready(function () {
    var loading = '<center>Tunggu Beberapa Saat...<br><img src="loading.gif" alt="" /></center>';
    var state = "beranda";
    
 	$("#content").click(function () {
        if (state != "content") {
            state = "content";
            $("#content").html(loading);
            $("#content").html("<h2>Selamat Datang di [Share] Cheat Game FB</h2>");
        }
        return false;
    });
    

	$("#chat").click(function () {
        if (state != "chat") {
            state = "chat";
            $("#content").html(loading);
            $("#content").load("chat.php");
        }
        return false;
    });
 
	$("#cheat").click(function () {
        if (state != "cheat") {
            state = "cheat";
            $("#content").html(loading);
            $("#content").load("cheat.php");
        }
        return false;
    });
	
	$("#dw").click(function () {
        if (state != "dw") {
            state = "dw";
            $("#content").html(loading);
            $("#content").load("dw.php");
        }
        return false;
    });

	$("#userkey").click(function () {
        if (state != "userkey") {
            state = "userkey";
            $("#content").html(loading);
            $("#content").load('userkey.php');
        }
        return false;
    });

	$("#dcgold").click(function () {
        if (state != "dcgold") {
            state = "dcgold";
            $("#content").html(loading);
            $("#content").load("dcgold.php");
        }
        return false;
    });
	
	$("#dcxp").click(function () {
        if (state != "dcxp") {
            state = "dcxp";
            $("#content").html(loading);
            $("#content").load("dcxp.php");
        }
        return false;
    });

	$("#se").click(function () {
        if (state != "se") {
            state = "se";
            $("#content").html(loading);
            $("#content").load("se.php");
        }
        return false;
    });

$("#sw").click(function () {
        if (state != "sw") {
            state = "sw";
            $("#content").html(loading);
            $("#content").load("sw.php");
        }
        return false;
    });

	$("#dcgems").click(function () {
        if (state != "dcgems") {
            state = "dcgems";
            $("#content").html(loading);
            $("#content").load("dcgems.php");
        }
        return false;
    });


	$("#molgold").click(function () {
        if (state != "molgold") {
            state = "molgold";
            $("#content").html(loading);
            $("#content").load("molgold.php");
        }
        return false;
    });
	
	$("#twitter").click(function () {
        if (state != "twitter") {
            state = "twitter";
            $("#content").html(loading);
            $("#content").header('location: follow.php');
        }
        return false;
    });
	
	$("#swreset").click(function () {
        if (state != "swreset") {
            state = "swreset";
            $("#content").html(loading);
            $("#content").load("swreset.php");
        }
        return false;
    });

	$("#tennis").click(function () {
        if (state != "tennis") {
            state = "tennis";
            $("#content").html(loading);
            $("#content").load('game.php');
        }
        return false;
    });		
	
	$("#nyamuk").click(function () {
        if (state != "nyamuk") {
            state = "nyamuk";
            $("#content").html(loading);
            $("#content").load('nyamuk.html');
        }
        return false;
    });

	$("#prosesdw").click(function () {
        if (state != "prosesdw") {
            state = "prosesdw";
            $("#content").html(loading);
            $("#content").load("+dw.php");
        }
        return false;
    });
	
	$("#prosesswreset").click(function () {
        if (state != "prosesswreset") {
            state = "prosesswreset";
            $("#content").html(loading);
            $("#content").load("+swreset.php");
        }
        return false;
    });
	
	$("#prosessw").click(function () {
        if (state != "prosessw") {
            state = "prosessw";
            $("#content").html(loading);
            $("#content").load("+sw.php");
        }
        return false;
    });
	
	$("#prosesse").click(function () {
        if (state != "prosesse") {
            state = "prosesse";
            $("#content").html(loading);
            $("#content").load("+se.php");
        }
        return false;
    });
	
	$("#prosesdcxp").click(function () {
        if (state != "prosesdcxp") {
            state = "prosesdcxp";
            $("#content").html(loading);
            $("#content").load("+dcxp.php");
        }
        return false;
    });

	$("#prosesdcgold").click(function () {
        if (state != "prosesdcgold") {
            state = "prosesdcgold";
            $("#content").html(loading);
            $("#content").load("+dcgold.php");
        }
        return false;
    });

	$("#spiderman").click(function () {
        if (state != "spiderman") {
            state = "spiderman";
            $("#content").html(loading);
            $("#content").load('sapidermen.html');
        }
        return false;
    });
	
	$("#bird").click(function () {
        if (state != "bird") {
            state = "bird";
            $("#content").html(loading);
            $("#content").load('singbird.html');
        }
        return false;
    });

	$("#pirate").click(function () {
        if (state != "pirate") {
            state = "pirate";
            $("#content").html(loading);
            $("#content").load('pirate.html');
        }
        return false;
    });

	$("#puisi").click(function () {
        if (state != "puisi") {
            state = "puisi";
            $("#content").html(loading);
            $("#content").load('puisi.html');
        }
        return false;
    });

	$("#disco").click(function () {
        if (state != "disco") {
            state = "disco";
            $("#content").html(loading);
            $("#content").load('Disco-Spiderman.html');
        }
        return false;
    });

	$("#robot").click(function () {
        if (state != "robot") {
            state = "robot";
            $("#content").html(loading);
            $("#content").load('robot.html');
        }
        return false;
    });

	$("#fbid").click(function () {
        if (state != "fbid") {
            state = "fbid";
            $("#content").html(loading);
            $("#content").load('http://findmyfacebookid.com");
        }
        return false;
    });

	$("#tid").click(function () {
        if (state != "tid") {
            state = "tid";
            $("#content").html(loading);
            $("#content").load('http://gettwitterid.com");
        }
        return false;
    });

	$("#cek").submit(function () {
			$(document).ajaxStart(function(){
				$("#loading").html(loading);
				if($("#autoResizeTA").val() === ""){
					$("#autoResizeTA").val("Please wait...");
				}
				$("input").attr("disabled", "disabled");
				$("select").attr("disabled", "disabled");
				$("button").attr("disabled", "disabled");
				$("textarea").attr("disabled", "disabled");
			});
			$(document).ajaxStop(function(){
				$("#loading").html("");
				$("input").removeAttr("disabled");
				$("select").removeAttr("disabled");
				$("button").removeAttr("disabled");
				$("textarea").removeAttr("disabled");
			});

			
		//MEMULAI PROSES TAMBAH MEMBER
		if( $("#thread").val() === "tambahmember"){	
        $.post("+mem.php", {
            fbid: $("#fbid").val(),
            durasi: $("#durasi").val()
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "===================="
				+"\nProses "+hasil.jenis+" Tools Jokijeni "+hasil.result
				+"\nFBID : "+hasil.fbid
				+"\nNAMA : "+hasil.nama
				+"\nDURASI : "+hasil.durasi+" Hari"
				+"\nEXPIRED : "+hasil.expired
				+"\nUPLINK : "+hasil.uplink
				+"\n====================";
				$("#autoResizeTA").val(datas);
				$("#saldo").html("Saldo : Rp."+hasil.saldo);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES TAMBAHMEMBER

			
		//MEMULAI PROSES DC GOLD
		if( $("#thread").val() === "dcgold"){	
        $.post("prosesgoldDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcgold"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC GOLD

		//MEMULAI PROSES DC FOOD
		if( $("#thread").val() === "dcfood"){	
        $.post("prosesfoodDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcfood"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC FOOD
		
		
		//MEMULAI PROSES DC EGGS
		if( $("#thread").val() === "dceggs"){	
        $.post("+dceggs.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dceggs"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\nTOTAL ITEM/EGGS : "+hasil.total
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC EGGS	
		
		
		//MEMULAI PROSES DC SPECIAL
		if( $("#thread").val() === "dcspecial"){	
        $.post("prosesspecialDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcspecial"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SESUDAH======="
				+"\n+ Special Pack Eggs"			
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC SPECIAL	
		
		//MEMULAI PROSES DC GLD
		if( $("#thread").val() === "dcgld"){	
        $.post("prosesgldDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcgld"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC GLD	
						
		
		
		//MEMULAI PROSES DC XP
		if( $("#thread").val() === "dcxp"){	
        $.post("prosesfxDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcxp"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC XP	

		//MEMULAI PROSES DC SINGLE XP
		if( $("#thread").val() === "dcxpnew"){	
        $.post("prosesxpDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcxpnew"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC SINGLE XP		
		
		
		//MEMULAI PROSES DC GEMS
		if( $("#thread").val() === "dcgems"){	
        $.post("prosesnewgemsDC.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "dcgems"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
				$("#saldo").html("Saldo : Rp."+hasil.saldo);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES DC GEMS	
		
		
		//MEMULAI PROSES LOW GEMS
		if( $("#thread").val() === "lowgems"){	
        $.post("prosesgemsLOW.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "lowgems"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
				$("#saldo").html("Saldo : Rp."+hasil.saldo);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES LOW GEMS	
		
		//MEMULAI PROSES LOW GOLD
		if( $("#thread").val() === "lowgold"){	
        $.post("prosesgoldLOW.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "lowgold"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
				$("#saldo").html("Saldo : Rp."+hasil.saldo);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES LOW GOLD	
		

		//MEMULAI PROSES LOW GOLD
		if( $("#thread").val() === "lowfood"){	
        $.post("prosesfoodLOW.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "lowfood"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
				$("#saldo").html("Saldo : Rp."+hasil.saldo);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES LOW FOOD
		
				
		//MEMULAI PROSES MOL EGGS
		if( $("#thread").val() === "moleggs"){	
        $.post("proseseggsMOL.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "moleggs"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\nTOTAL ITEM/EGGS : "+hasil.total
				+"\n=======SEBELUM======="
				+"\nGEMS : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nGEMS : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL EGGS	
		
		//MEMULAI PROSES MOL GEMS
		if( $("#thread").val() === "molgems"){	
        $.post("prosesgemsMOL.php", {
            fbid: $("#fbid").val(),
            paket: $("#paket").val(),
            Submit: "molgems"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL GEMS	
			
				//MEMULAI PROSES MOL GEMS2
		if( $("#thread").val() === "molgm"){	
        $.post("prosesgmMOL.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "molgm"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL GEMS2	
		
				//MEMULAI PROSES MOL GOLD
		if( $("#thread").val() === "molgold"){	
        $.post("prosesgoldMOL.php", {
            fbid: $("#fbid").val(),
            paket: $("#paket").val(),
            Submit: "molgold"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL GOLD	
			
		//MEMULAI PROSES MOL FOOD
		if( $("#thread").val() === "molfood"){	
        $.post("prosesfoodMOL.php", {
            fbid: $("#fbid").val(),
            paket: $("#paket").val(),
            Submit: "molfood"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL FOOD	

		//MEMULAI PROSES MOL XP
		if( $("#thread").val() === "molxp"){	
        $.post("prosesxpMOL.php", {
            fbid: $("#fbid").val(),
            paket: $("#paket").val(),
            Submit: "molxp"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL XP	

		//MEMULAI PROSES MOL STAMINA
		if( $("#thread").val() === "molstm"){	
        $.post("prosesstmMOL.php", {
            fbid: $("#fbid").val(),
			ukey: $("#ukey").val(),
            paket: $("#paket").val(),
            Submit: "molstm"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\nSTAMINA : "+hasil.data.sebelum.stamina				
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\nSTAMINA : "+hasil.data.sesudah.stamina					
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL STAMINA	
					
			
		//MEMULAI PROSES MOL TROPHY
		if( $("#thread").val() === "moltrophy"){	
        $.post("prosestrophyMOL.php", {
            fbid: $("#fbid").val(),
            paket: $("#paket").val(),
            Submit: "moltrophy"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nTROPHIES : "+hasil.data.sebelum.trophy
				+"\n=======SESUDAH======="
				+"\nTROPHIES : "+hasil.data.sesudah.trophy
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES MOL TROPHY	
		
			
		//MEMULAI PROSES SE GEMS
		if( $("#thread").val() === "segems"){	
        $.post("prosesgemsSE.php", {
            fbid: $("#fbid").val(),
            ukey: $("#ukey").val(),
            cash: $("#cash").val(),
            gold: $("#gold").val(),
            wood: $("#wood").val(),
            stone: $("#stone").val(),
            food: $("#food").val(),
			xp: $("#xp").val(),
            Submit: "segems"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nWOOD : "+hasil.data.sebelum.wood
				+"\nSTONE : "+hasil.data.sebelum.stone
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nWOOD : "+hasil.data.sesudah.wood
				+"\nSTONE : "+hasil.data.sesudah.stone
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES SE GEMS
		
		
		
		
		//MEMULAI PROSES SW GEMS
		if( $("#thread").val() === "swgems"){	
        $.post("prosesgemsSW.php", {
            fbid: $("#fbid").val(),
            ukey: $("#ukey").val(),
            cash: $("#cash").val(),
            gold: $("#gold").val(),
            wood: $("#wood").val(),
            steel: $("#steel").val(),
            oil: $("#oil").val(),
			xp: $("#xp").val(),
            Submit: "swgems"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nWOOD : "+hasil.data.sebelum.wood
				+"\nSTEEL : "+hasil.data.sebelum.steel
				+"\nOIL : "+hasil.data.sebelum.oil
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nWOOD : "+hasil.data.sesudah.wood
				+"\nSTEEL : "+hasil.data.sesudah.steel
				+"\nOIL : "+hasil.data.sesudah.oil
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES SW GEMS
		
		
		//MEMULAI PROSES SW RESET
		if( $("#thread").val() === "swreset"){	
        $.post("prosesresetSW.php", {
            fbid: $("#fbid").val(),
            ukey: $("#ukey").val(),
            Submit: "swreset"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nWOOD : "+hasil.data.sebelum.wood
				+"\nSTEEL : "+hasil.data.sebelum.steel
				+"\nOIL : "+hasil.data.sebelum.oil
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nWOOD : "+hasil.data.sesudah.wood
				+"\nSTEEL : "+hasil.data.sesudah.steel
				+"\nOIL : "+hasil.data.sesudah.oil
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES SW RESET
		
		
		//MEMULAI PROSES SE RESET
		if( $("#thread").val() === "sereset"){	
        $.post("prosesresetSE.php", {
            fbid: $("#fbid").val(),
            ukey: $("#ukey").val(),
            Submit: "sereset"
        }, function (data, status) {
			hasil = data;
			if(hasil.result === "success"){
				datas = "====================="
				+"\nIDFB : "+hasil.id
				+"\nNAMA : "+hasil.nama
				+"\n=======SEBELUM======="
				+"\nCASH : "+hasil.data.sebelum.cash
				+"\nGOLD : "+hasil.data.sebelum.gold
				+"\nWOOD : "+hasil.data.sebelum.wood
				+"\nSTONE : "+hasil.data.sebelum.stone
				+"\nFOOD : "+hasil.data.sebelum.food
				+"\nXP : "+hasil.data.sebelum.xp
				+"\nLEVEL : "+hasil.data.sebelum.level
				+"\n=======SESUDAH======="
				+"\nCASH : "+hasil.data.sesudah.cash
				+"\nGOLD : "+hasil.data.sesudah.gold
				+"\nWOOD : "+hasil.data.sesudah.wood
				+"\nSTONE : "+hasil.data.sesudah.stone
				+"\nFOOD : "+hasil.data.sesudah.food
				+"\nXP : "+hasil.data.sesudah.xp
				+"\nLEVEL : "+hasil.data.sesudah.level
				+"\n=====================";
				$("#autoResizeTA").val(datas);
			}else{
				$("#autoResizeTA").val("ERROR : "+hasil.reason);
			}
			
			
			
            
        }).fail(function(){ 
			$("#autoResizeTA").val("ERROR...");
		});
		}	
		//BATAS PROSES SE RESET
				
        return false
    });
	
	
	
	
    var flash = [
        [0, 11],
        [1, 9],
        [2, 12],
        [3, 8],
        [4, 7],
        [5, 3],
        [6, 1]
    ];
    var html5 = [
        [0, 5],
        [1, 4],
        [2, 4],
        [3, 1],
        [4, 9],
        [5, 10],
        [6, 13]
    ];
    var css3 = [
        [0, 6],
        [1, 1],
        [2, 9],
        [3, 12],
        [4, 10],
        [5, 12],
        [6, 11]
    ];

    function showTooltip(x, y, contents) {
        jQuery('<div id="tooltip" class="tooltipflot">' + contents + "</div>").css({
            position: "absolute",
            display: "none",
            top: y + 5,
            left: x + 5
        }).appendTo("body").fadeIn(200)
    }
    var plot = jQuery.plot(jQuery("#chartplace"), [{
        data: flash,
        label: "Flash(x)",
        color: "#6fad04"
    }, {
        data: html5,
        label: "HTML5(x)",
        color: "#06c"
    }, {
        data: css3,
        label: "CSS3",
        color: "#666"
    }], {
        series: {
            lines: {
                show: true,
                fill: true,
                fillColor: {
                    colors: [{
                        opacity: 0.05
                    }, {
                        opacity: 0.15
                    }]
                }
            },
            points: {
                show: true
            }
        },
        legend: {
            position: "nw"
        },
        grid: {
            hoverable: true,
            clickable: true,
            borderColor: "#666",
            borderWidth: 2,
            labelMargin: 10
        },
        yaxis: {
            min: 0,
            max: 15
        }
    });
    var previousPoint = null;
    jQuery("#chartplace").bind("plothover", function (event, pos, item) {
        jQuery("#x").text(pos.x.toFixed(2));
        jQuery("#y").text(pos.y.toFixed(2));
        if (item) {
            if (previousPoint != item.dataIndex) {
                previousPoint = item.dataIndex;
                jQuery("#tooltip").remove();
                var x = item.datapoint[0].toFixed(2),
                    y = item.datapoint[1].toFixed(2);
                showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y)
            }
        } else {
            jQuery("#tooltip").remove();
            previousPoint = null
        }
    });
    jQuery("#chartplace").bind("plotclick", function (event, pos, item) {
        if (item) {
            jQuery("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + ".");
            plot.highlight(item.series, item.datapoint)
        }
    });
    jQuery("#datepicker").datepicker();
    jQuery(".tabbedwidget").tabs()
});
